<h1>Edit User "<?=$user->first_name?> <?=$user->last_name?>"</h1>

<form method="post" action="edit">
	<input type="hidden" name="user_id" value="<?=$user->id?>" />
	<p><label for="user_id">User ID:</label><?=$user->id?></p>
	<p><label for="last_login">Last Login:</label><?=unix_to_user($user->last_login,$user->timezone)?></p>
	<p><label for="created_on">Created On:</label><?=unix_to_user($user->created_on,$user->timezone)?></p>
	<p><label for="first_name">First Name:</label><input type="text" name="first_name" value="<?=$user->first_name?>" /></p>
	<p><label for="last_name">Last Name:</label><input type="text" name="last_name" value="<?=$user->last_name?>" /></p>
	<p><label for="email">Email:</label><input type="text" name="email" value="<?=$user->email?>" /></p>
	<p><label for="group_id">Group:</label><?=form_dropdown('group_id', $groups, $user->group_id)?></p>
	<p><label for="timezone">Timezone:</label><?=timezone_menu($user->timezone)?></p>
	<p><label for="country">Country:</label><?=form_dropdown('country_id', $countries, $user->country_id)?></p>
	<p><input type="submit" value="Save" onClick="return confirm('Are you sure you want to make the following changes?')" />
		&nbsp;&nbsp;<a href="<?=base_url()?>users/profile/" onClick="return confirm('Are you sure you want to cancel the changes?')" style="text-decoration: none"><input type="button" value="Cancel" /></a>
	</p>
</form>

<h2>Other Details:</h2>

<p>
	<label for="status"><strong>Status:</strong></label><?=$user->status?><br />
	<label for="options">&nbsp;</label><?=$user->activate_link?><?=$user->ban_link?> |
	<a onClick="return confirm('Are you sure you want to delete <?=$user->first_name?> <?=$user->last_name?>\'s account?')"
	   href="<?=base_url()?>users/delete/<?=$user->id?>">Delete</a>
</p>

<br />
<strong>Ban history:</strong><br />
<?
if(!$ban_history)
{
	echo 'User has never been banned';
}
else
{
	?>
<table style="text-align: left">
	<?
	foreach($ban_history as $b)
	{
		?>
	<tr>
		<td width="150"><?=unix_to_user($b->time, $this->session->userdata('timezone'))?></td>
		<td><span style="color: red"><?=$b->reason?></span></td>
	</tr>
	<? if($b->time_end > 0) { ?>
	<tr>
		<td width="150"><?=unix_to_user($b->time_end, $this->session->userdata('timezone'))?></td>
		<td><span style="color: green">Unbanned</span></td>
	</tr>
	<? } ?>
		<?
	}
}
?>
</table>